package com.cn.controller;

import com.cn.baseModel.DataResponse;
import com.cn.service.AngelService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/angel")
public class AngelController {
    @Resource
    private AngelService angelService;

    /**
     * 查询所有角度
     * @return
     */
    @PostMapping(value = "/angels")
    public DataResponse angels (){
        return DataResponse.success(angelService.queryAngels());
    }

    /**
     * 根据ID查询角度
     * @return
     */
    @GetMapping(value = "/getAngelByID/{ID}")
    public DataResponse getAngelByID(@PathVariable("ID") String ID){
        return DataResponse.success(angelService.getAngelByID(ID));
    }
}
